package com.youkeda.yikao.web.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author ：chenzikang
 * @date ： 2019/8/31 14:12
 */

@Configuration
public class LoginWebMvcConfigurer implements WebMvcConfigurer {

    //依赖注入，调用AuthHanderlnterceptor类的方法
    @Autowired
    private AuthHanderlnterceptor authHanderlnterceptor;

    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(authHanderlnterceptor).addPathPatterns("/**");
    }

}
